package com.kfgj.hkp.common.journal.enums;


import com.kfgj.hkp.common.dic.Dictionary;
import com.kfgj.hkp.common.dic.DictionaryProvider;

import java.util.ArrayList;
import java.util.List;

/**
 * @version 1.0
 * @description TODO
 * @auth liwensihan
 * @date 2018/8/14 16:08
 *
 * 如果在具体项目中，可以继承OperationType
 */
public class OperationType implements DictionaryProvider {


    public static final Dictionary OperationType;
    public static final Dictionary Create;
    public static final Dictionary Update;
    public static final Dictionary Delete;
    public static final Dictionary Query;

    static {
        OperationType = new Dictionary(getOperationTypeKey(),getOperationTypeParentCode(),"日志操作类型");
        Create = new Dictionary(getOperationTypeKey(),"Create","新增",getOperationTypeParentCode());
        Update = new Dictionary(getOperationTypeKey(),"Update","修改",getOperationTypeParentCode());
        Delete = new Dictionary(getOperationTypeKey(),"Delete","删除",getOperationTypeParentCode());
        Query = new Dictionary(getOperationTypeKey(),"Query","查询",getOperationTypeParentCode());
    }


    @Override
    public List<Dictionary> produce() {

        List<Dictionary> list = new ArrayList<Dictionary>();
        list.add(OperationType);
        list.add(Create);
        list.add(Update);
        list.add(Delete);
        list.add(Query);
        return list;
    }

    public static String getOperationTypeParentCode(){
        return OperationType.class.getSimpleName();
    }

    public static String getOperationTypeKey(){
        return OperationType.class.getName();
    }
}
